package domain

type MsgReadRecords []ChannelMsgReadRecord

func (m MsgReadRecords) ReadRecord(cid int64) ChannelMsgReadRecord {
	for idx := range m {
		if m[idx].ChannelID == cid {
			return m[idx]
		}
	}
	return ChannelMsgReadRecord{}
}

type User struct {
	ID                    int64
	Nickname              string
	Avatar                string
	Token                 string
	ChannelMsgReadRecords MsgReadRecords
	Ctime                 int64
	Utime                 int64
}

type ChannelMsgReadRecord struct {
	ChannelID int64
	LastMsgID int64
}
